<template>
	<view>
		<view class="bj">
			<u-navbar title="个人中心" :autoBack="true" bgColor="#3284fc"
				titleStyle="font-size:18px; color:white;height:44px;line-height:44px" leftIconColor="#fff">
			</u-navbar>
			<image src="../../static/logo.png" class="im"></image>
			<view style="text-align: center;margin-top: -30px; color: #fff; font-size: 16px;" v-if="user.sysUser!=null">
				{{user.sysUser.nickName}} {{user.sysUser.phonenumber}}
			</view>
			<u-cell-group :border="false"
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px'}">
				<u-cell icon="/static/images/yhj@2x.png" value="3张" :isLink="true">
					<template v-slot:title>
						<navigator url='/pages/shihao/youhuijuan/youhuijuan' style="margin-left: 5px;">我的优惠劵</navigator>
					</template>
					<template v-slot:value>
						<span style="margin-left: 5px;">3张</span>
					</template>
				</u-cell>
			</u-cell-group>
			<u-cell-group
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'-5px auto',width:'350px'}">
				<navigator url='/pages/my/wddd/wddd?a=quanbu&b=待评价'>
					<u-cell :isLink="true" value="全部订单">
						<template v-slot:title>
							<span style="margin-left: 5px;">我的订单</span>
						</template>
					</u-cell>
				</navigator>
				<view class="dd">
					<navigator url='/pages/my/wddd/wddd?a=zhifu&b=待支付'>待支付</navigator>
					<navigator url='/pages/my/wddd/wddd?a=shiyong&b=待使用'>待使用</navigator>
					<navigator url='/pages/my/wddd/wddd?a=pingjia&b=待评价'>待评价</navigator>
				</view>
			</u-cell-group>
			<u-cell-group
				:customStyle="{backgroundColor:'#ffffff',borderRadius:'10px',margin:'10px auto',width:'350px'}">
				<u-cell :isLink="false">
					<template v-slot:title>
						<span style="margin-left: 5px;">我的服务</span>
					</template>
				</u-cell>
				<u-grid :border="false" col="4">
					<u-grid-item v-for="(baseListItem,baseListIndex) in baseList" :key="baseListIndex">
						<u-icon @click="click(baseListItem.urll)"
							:customStyle="{paddingTop:30+'rpx',paddingBottom:10+'rpx'}" :name="baseListItem.name"
							:size="24"></u-icon>
						<text @click="click(baseListItem.urll)"
							style="padding-bottom: 10px;">{{baseListItem.title}}</text>
					</u-grid-item>
				</u-grid>
			</u-cell-group>
			<u-button text="退出登录"></u-button>
			<!-- 	<view class="dh"></view>
			<image class="ima" src="@/static/images/sj@2x.png" style="width: 20px; height: 20px;"></image> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseList: [{
						name: "/static/images/9@3x4.png",
						title: "领卷中心",
						urll: '/pages/shihao/lingjuan/lingjuan'

					},
					{
						name: "/static/images/9@3x5.png",
						title: "邀请好友",


					},
					{
						name: "/static/images/9@3x6.png",
						title: "我的车辆",
						urll: '/pages/shihao/mycar/mycar'

					},
					{
						name: "/static/images/9@3x7.png",
						title: "消费记录",
						urll: '/pages/shihao/consume/consume'

					},
					{
						name: "/static/images/9@3x8.png",
						title: "我的维修",
						urll: '/pages/shihao/weixiu/01jinxingzhong/01jinxingzhong'

					},
					{
						name: "/static/images/9@3x9.png",
						title: "意见反馈",


					},
					{
						name: "/static/images/9@3x10.png",
						title: "收货地址",


					}
				],
				user: ''
			}
		},
		onLoad() {
			this.getUser()
		},
		methods: {
			click(uurl) {
				uni.navigateTo({
					url: uurl
				})
			},
			getCookie(name) {
				const nameEQ = name + "=";
				const cookies = document.cookie.split(';');
				for (let i = 0; i < cookies.length; i++) {
					let c = cookies[i].trim();
					if (c.indexOf(nameEQ) === 0) {
						return decodeURIComponent(c.substring(nameEQ.length));
					}
				}
				return null;
			},
			getId() {
				console.log(this.getCookie('userid'));
			},
			getUser() {
				let that = this;
				this.$http({
					url: 'api/user/userr/getxiangxi/' + that.getCookie('userid'),
					mtehod: "GET",
					success(res) {
						console.log(res)
						that.user = res.data.data;
					}
				})
			}

		}
	}
</script>

<style scoped>
	.tabbar {
		display: flex;
		justify-content: space-around;
		align-items: center;
		height: 50px;
		background-image: url('/static/c8.png');
		/* 背景图片路径 */
		background-size: cover;
		/* 设置背景图片覆盖 */
	}

	.ima {
		background-image: url(@/static/images/5@2x.png);
		background-size: cover;
		padding: 25px 25px;
		position: fixed;
		bottom: 15px;
		left: 152px;
	}

	.dh {
		width: 100%;
		height: 50px;
		background-image: url(@/static/images/12@2x.png);
		background-size: cover;
		position: fixed;
		bottom: 0;
	}

	.u-button {
		width: 300px;
		border-radius: 20px;
		margin-top: 20px;
		background-color: #dadada;
		color: #fff;
	}

	.dd navigator:nth-child(1),
	.dd navigator:nth-child(2),
	.dd navigator:nth-child(3) {
		width: 100px;
		height: 50px;
		text-align: center;
		line-height: 50px;
		color: white;
		background: url(@/static/images/9@3x1.png);
		background-size: cover;
		border-radius: 5px;
	}

	.dd navigator:nth-child(2) {
		background-image: url(@/static/images/9@3x3.png);
	}

	.dd navigator:nth-child(3) {
		background-image: url(@/static/images/9@3x2.png);
	}

	.dd {
		display: flex;
		justify-content: space-around;
		margin: 20px 0;
	}

	.bj .im {
		width: 80px;
		height: 80px;
		border-radius: 50%;
		margin: 30px 140px;
	}

	.bj {
		width: 100%;
		height: 180px;
		background-color: #3384fc;
		margin-top: 44px;
		position: relative;
	}
</style>